﻿using Godot;

public partial class StateMachine : Node
{
	private State currentState;
	
	public override void _Process(double delta)
	{
		currentState?.Process(delta);
	}
	
	public override void _PhysicsProcess(double delta)
	{
		currentState?.PhysicsProcess(delta);
	}

	
	public void Start(State StartState)
	{
		currentState = StartState;
		currentState.Enter();
	}

	public void SwitchState(State newState)
	{
		currentState.Exit();
		currentState = newState;
		currentState.Enter();
	}
}